Repository navigation
ci(doop): train S4c sandbox, isolation probes, env allowlist, sweep, smoke (CHE-5548) [squash] - #56
Merged
Merged
Conversation
congvc-bot-x99
Bot
force-pushed
the
agent/tofu/che-5548-2644b627ca4a
branch
from
November 18, 2026 03:30
f22074a to
e9b8b03
Compare
Base automatically changed from
agent/tofu/che-6524-550542076b5a
to
cheese/main
November 18, 2026 04:29
added 4 commits
November 18, 2026 11:29
…sweep, smoke (CHE-5548)
…ndbox gateway (CHE-5548)
…d (CHE-5548) - proveQuiescence: kill, wait, record (pid, backend_start), terminate, prove three facts inside one 30 s budget; every step bounded; a timeout leaves a fact unproven. - Failed migration: clone ledger must equal the pre-migration ledger. - needs_operator writes a guard file that no sweep removes, keeps the sandbox, skips the final sweep. runCompat, c00.sh apply, rollback, sweep and guard refuse until the facts hold; lift calls c00.sh guard. - Tests: stuck docker kill/wait/inspect/psql, later job after a failed proof, c00.sh refusal. Run against the previous implementation: 67 of 107 failed. Written after the code, so retrospective test-first.
…ion, clear it only after proof (CHE-5548) Red (6 failures) before the change, green (174 passed across compat and c00 suites) after.
congvc-dev
force-pushed
the
agent/tofu/che-5548-2644b627ca4a
branch
from
November 18, 2026 04:29
e9b8b03 to
212ddb7
Compare
added 10 commits
November 18, 2026 21:46
…CanvasBrowser (CHE-6913)
…imports (CHE-7020) Chrome aborts in-flight requests with net::ERR_NETWORK_CHANGED when host network interfaces change. The module script in drawing.html then never sets window.drawingHarness and no wait recovers. Print pageerror/requestfailed/ readyState on a stall and load the page again (3 tries, 8s ready wait).
…E-7021) The first seedPanel wait timed out at the 5 s puppeteer default on CI shard 2 (run 44129413615, job 134202011472). Widen the file default and the one explicit 5 s poll to 12 s, under the 15 s per-test limit.
…-6841) cheese/main carries its own flake fix (doop-design#433) and the ci-policy R1 push-trigger rule, so the #64 commits are dropped here and the test files take main's version. Smoke routes gain /api/agent-runners and /api/fonts and follow the new /api/model-account view.
…ns, icons, photos (CHE-6841)
…ders contract (CHE-7697)
…-5549) [squash] (#99) * ci(doop): train S5 readback delay, confirm, rollback readback, evidence (CHE-5549) Rules C-9 and C-12 of CHE-5474. Ships with DOOP_DEPLOY_TRAIN absent or off. * ci(doop): prove quiescence and decide confirm and rollback under the lock (CHE-5549) Review round 1 on the S5 slice: - deploy-gate recheck runs the real quiescence proof (c00.sh quiescence) instead of a hardcoded ok. - c00.sh confirm and rollback prove migration quiescence under the lock, switch on or off. - The confirm and rollback checks run inside c00.sh after take_lock, so a newer deployment or a changed marker that lands while waiting for the lock is seen (superseded, none, refused); the workflow no longer decides before the lock. - The rollback job is one c00.sh step; the marker token and suspension follow the step's own go output. * fix(cd): give readback-confirm the compose dir and Postgres container (CHE-5549) Quiescence in confirm reads the live database, so the job needs the same C00_COMPOSE_DIR and C00_PG_CONTAINER as deploy and rollback. Test drives c00.sh with only each job's own env block. --------- Co-authored-by: congvc-bot[bot] <3634010+congvc-bot[bot]@users.noreply.github.com>
…#103) * ci(doop): train S5 readback delay, confirm, rollback readback, evidence (CHE-5549) Rules C-9 and C-12 of CHE-5474. Ships with DOOP_DEPLOY_TRAIN absent or off. * ci(doop): prove quiescence and decide confirm and rollback under the lock (CHE-5549) Review round 1 on the S5 slice: - deploy-gate recheck runs the real quiescence proof (c00.sh quiescence) instead of a hardcoded ok. - c00.sh confirm and rollback prove migration quiescence under the lock, switch on or off. - The confirm and rollback checks run inside c00.sh after take_lock, so a newer deployment or a changed marker that lands while waiting for the lock is seen (superseded, none, refused); the workflow no longer decides before the lock. - The rollback job is one c00.sh step; the marker token and suspension follow the step's own go output. * fix(cd): give readback-confirm the compose dir and Postgres container (CHE-5549) Quiescence in confirm reads the live database, so the job needs the same C00_COMPOSE_DIR and C00_PG_CONTAINER as deploy and rollback. Test drives c00.sh with only each job's own env block. * ci(doop): train S7 watchers and /healthz revision (CHE-5550) * fix(ci): keep the last confirmed deploy durably for the D2 watchers (CHE-5550) The watchers searched only the 30 newest D2 runs for a confirmed deployment. After 30 skipped slots the SHA came back null: the live watch then passed an unreachable /healthz and the freshness watch treated the deployed candidate as overdue. - D2's evidence job records each confirmed deploy as a GitHub deployment (environment c00-doop, deployments: write), read back before the step passes. - The last successful D2 SHA is tri-state: known, none (a proven first deployment) or unknown. Unknown history alarms and fails visibly. - Artifact scan is only the fallback: paginated, up to 100 runs, and a green run whose evidence is gone counts as unknown. - /healthz must be healthy with a 40-hex revision even when nothing deployed. * fix(ci): reconcile the deploy record with newer D2 evidence and send typed booleans (CHE-5550) A prior deployment record no longer hides a newer confirmed deploy whose own record write failed: that history is unknown and fails both watchers visibly. The record carries its D2 run id; auto_merge and production_environment go out as JSON booleans (gh api -F) and the request and failure path are tested. * fix(ci): treat a newer D2 run with no evidence as unknown, not skipped (CHE-5550) * fix(ci): order the last confirmed D2 deploy by confirmation time, not run ID (CHE-8873, CHE-5550) Round 4 P1: an older run can confirm after a newer run recorded another SHA. Check every run active at or after the record's confirmation, treat unfinished runs as pending/stuck, record the confirmation time in the deployment description. * fix(ci): a pending D2 run no longer hides the 90 min alarm or a failed /healthz (CHE-8873, CHE-5550) --------- Co-authored-by: congvc-bot[bot] <3634010+congvc-bot[bot]@users.noreply.github.com>
* ci(doop): train S3b — audited lift workflow (CHE-5551) Add cd-lift.yml, the only way from armed/suspended back to clear (plan CHE-5474 C-10.6, C-10.7). Dispatch only, one input (decision_id), allowlisted dispatcher, C00 runner under the host deploy lock. scripts/deploy-lift.mjs refuses unless the Multica decision is an approved doop.deploy_lift by the configured approver, not withdrawn/revoked/expired, its marker_value equals the standing marker and repo matches, quiescence and /healthz are proven, and the decision and marker still hold when re-read right before the write. It then writes clear:<nonce>:<run id>, reads it back and records lift-evidence.json. A refusal leaves the marker unchanged. c00.sh gains a `lift` command (guard, lock, quiescence, digest, revision label, container health). deploy-marker.mjs gains lift() and exports readMarker(). The train switch DOOP_DEPLOY_TRAIN is not touched. * fix(ci): lift refuses a decision answer that omits withdrawn_at, revoked_at or expires_at (CHE-5551) --------- Co-authored-by: congvc-bot[bot] <3634010+congvc-bot[bot]@users.noreply.github.com>
… lift e2e clock (CHE-5548)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Closes CHE-5548
Train slice S4c of CHE-5474 (rules C-8.5b to C-8.5d), issue CHE-5548. Stacked on #53 (S4b-1 runner), now merged, so the base is
cheese/main.DOOP_DEPLOY_TRAINstays absent oroff. This approves no deploy. Nothing here is called by a workflow yet: wiring waits for S2 (#46) and S5. Gate-path slice: needs a cross-lab code signer (x99-codex-terra). No review is waived.What is added
scripts/compat-sandbox.mjs:runCompatclones the live DB into adocker network create --internalnetwork (pg_dump | pg_restore, no pull, no build, no published port, no mount), runs the candidate migration (server/db/migrate.ts, S4b-1) on the clone, runs the isolation probes, boots the predecessor and runs the smoke suite from the candidate image.verifyEvidenceandledgerHashare deploy step 1. CLI:run,verify.scripts/compat-env.mjs: the exact 7-key predecessor env (never copied fromprocess.env).scripts/deploy-smoke.mjs+deploy/cd/smoke-routes.json: one read and one write for each of the 44 route groups.scripts/route-groups.mjsderives the groups fromserver/.deploy/cd/c00.sh sweep: removes everydoop.compat.runcontainer, network, volume (in that order), reads back zero, printsdfbefore and after. Needs no compose dir and no deploy ref.Dockerfile: copies the smoke script and routes file into the runtime stage.Test-first evidence (observed)
Red: tests written first, run against stubs of the new modules and no
sweepcommand. Result:Test Files 4 failed (4),Tests 56 failed | 8 passed | 4 skipped (68). The 8 passes are pure-stub coincidences (negative cases). The 4 skipped are the Docker fixture, whosebeforeAllfailed against the stub. Green after implementation:Test Files 5 passed (5),Tests 94 passed (94)(the four new files plustests/c00Deploy.test.ts), real Docker included.static diff that is insufficient stops before any sandbox exists,a missing static result is insufficienta migration that fails on the existing data is insufficient, and the predecessor never startspredecessor health or a smoke call failing on the clone is insufficient,smoke output that cannot be read is insufficientlow disk (free < 3x the live database) is insufficient and nothing is clonedsmoke-routes.jsonfails CIreports a server group that smoke-routes.json does not list,gives every listed group one read and one write,passes every listed read and write(real server, 88 calls)sweeps first and again at the end, after success,sweeps at the end after a failure too…,…when an unexpected error escapes, and rethrows itrefuses evidence for another predecessor digest,…another ledger hash,…another candidate sha,refuses failed, partial, missing and unreadable evidencenode:22-slim)tests/compatIsolationDocker.test.ts:a container on the internal network cannot reach…,a background worker that starts after boot cannot reach out either, plus a positive control (the probe can tell…)starts the predecessor with only the allowlisted env, no mounts, cap-drop ALL, read-only, tmpfs /tmp,a predecessor whose inspect shows a foreign env key, a mount or a published port blocks startupa probe that reaches an external address blocks startup,reaching %s blocks startup(x3),a probe that cannot run…,…leaves a target unanswered…,a network that is not Internal, or holds a foreign container…every other key in server/env.ts is absent from the allowlist…tests/c00Sweep.test.ts(stub docker) andafter a killed compat job the next sweep removes every labelled resource and reads back zero(real Docker);a failed first sweep fails the job before any other step,…removal itself failsOther checks:
bun run typecheck,bun run lint,bun run format:check,bun run buildpass.doc-lintpasses with one stale-docs warning./verifypregate test lane reported TIMEOUT: it selects tests againstorigin/main, which here is the whole unmerged stack. I ran the slice's files directly instead.Not observed here (say so before relying on it)
runCompatagainst a real Postgres image and a built candidate image. The orchestrator is proven against a scripted Docker; isolation is proven with real Docker on a fixture. The first real C00 run will be the first timepg_dump | pg_restore, the--read-onlypredecessor boot and the smoke run meet real images. If the app needs a writable path beyond/tmp, the smoke step fails closed (insufficient evidence), not open.runwiring (gateway and live Postgres address lookup, the real runner) has no automated test.Cleanup
Docker fixture resources are labelled
doop.compat.runand removed byc00.sh sweepin its ownafterAll; read back zero.node:22-slimstays pulled on X99.CHE-7697 fix round: smoke write chains (head
50608e1f)Finding (x99-codex-terra, P1 silent-guard, C-8.5c: one read and one write per route group):
/api/agentsand/api/image-descriptionsonly read;/api/custom-providershad a GET 404-or-200 contract that an absent route passes./api/agents:POSTcreate,GETread-back,PATCHblurb,GETread-back, all on the throwaway user in the clone.noWriteremoved./api/image-descriptions:GET(defaultaccount),PUT {mode:'off'},GETread-back.noWriteremoved./api/custom-providers:POST {}contract with newexpectByStatus: 400 must carryGive the provider a name(feature on), 404 must carrycustom providers are off on this server(feature off). Any other status or body fails, so an absent route, a 200 or a 5xx fails.scripts/deploy-smoke.mjs:expectByStatussupport (the allowed statuses are its keys; the body check follows the status that came back).Test command:
bunx vitest run tests/compatSmoke.test.ts tests/compatSandbox.test.ts tests/c00Guard.test.ts tests/c00Sweep.test.tsRed (new tests, before the fix, booted server on X99):
tests/compatSmoke.test.tsTests 6 failed | 21 passed (27): the two route-shape tests, theexpectByStatusscripted test, and the real-server tests for agents, image-descriptions and custom-providers.Green (this head):
compatSmokeTests 27 passed (27); the four files togetherTest Files 4 passed (4),Tests 147 passed (147).bun run typecheckand oxlint on the changed files pass.Failing-write proof (real server): a refused
POST /api/agents(body{name:'x'}), aPATCHwhose read-back differs, a refusedPUTmode (nonsense) and aPUTmodeserverread back asoffeach makerunSmokefail and name the group. The custom-providers contract passes on a server with the feature on (400) and on one booted withDOOP_CUSTOM_PROVIDERS=false(404), and a wrong expected body fails.DOOP_DEPLOY_TRAINstays absent oroff. This approves no deploy. Nothing built or run on C00.Changelog
No user-facing change. CI-only: the deploy train's compat smoke suite now writes and reads back
/api/agentsand/api/image-descriptionsand checks a real on/off contract for/api/custom-providers. Not released; the train switch stays off.